﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace black_screen_mode_server.DataCommunication
{
    public class DataPacket : IPacketData
    {
        public int PacketType { get; set; }
        public string PacketData { get; set; }

     
        public void JsonToPacket(string jsonData)
        {
            var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<DataPacket>(jsonData);
            PacketType = obj.PacketType;
            PacketData = obj.PacketData;
        }

        public string PacketToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }
}
